<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="__PUBLIC__/Css/Home/login.css">
</head>
<body>
	<div class="login_zong">
		<div {:session('url',$_SERVER["HTTP_REFERER"])} class="login_top">
			<img id="login_mi_gif" src="__PUBLIC__/images/login_mi.gif">
			<img id="login_xiaomi_logo_gif" src="__PUBLIC__/images/login_xiaomi_logo.gif" alt="">
			<font size="6" id="login_text">
				小米账号登录
			</font>
		</div>
		<div class="login_content">
		<form action="{:U('User/gologin')}" method="post" id="form">
			<input type="text" name="username" id="login_content_username" placeholder="   邮箱/手机号/小米账号"><span  class="login_content_span" id="spana"></span>
			<input type="password" name="userpwd" id="login_content_userpass" placeholder="   秘密">
			<input type="submit" id="login_content_submit" value="立即登录" >
		</form>
			<div class="login_content_border"></div>
			<div class="login_content_border1">
				其他方式登录
			</div>
			<div class="login_content_border2"></div>
		</div>
		<div class="clear"></div>
		<div class="login_footer">
			<div id="login_footer_login_qq_gif"><a href="#"><img  src="__PUBLIC__/images/login_qq.gif" alt="" /></a></div>
			<div id="login_footer_login_sina_gif" ><a href="#"><img src="__PUBLIC__/images/login_sina.gif" alt="" /></a></div>
			<div id="login_footer_login_zhifu_gif"><a href="#"><img  src="__PUBLIC__/images/login_zhifu.gif" alt="" /></a></div>
			<div class="clear"></div>
			<div class="login_footer_footer">
				<a href="#">注册小米账号</a>
				<a href="#">忘记密码</a>
			</div>
		</div>
	</div>
	<div class="login_bottom">
		<ul class="login_bottom_ul">
			<li><a href="#">简体</a><span class="login_ul_span">|</span></li>
			<li><a href="#">繁体</a><span class="login_ul_span">|</span></li>
			<li><a href="#">English</a><span class="login_ul_span">|</span></li>
			<li><a href="#">常见问题</a></li>
		</ul>
		<span class="login_bottom_text">小米公司版權所有-京ICP備10046444<img src="__PUBLIC__/images/login_bottom_jing.gif">京公網安備11010802020134號-京ICP證110507號</span>
	</div>
	<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
	<script>
	 	

		var backname = false;
		var backpwd  = false;
		$(function(){
			var backname = false;
			var backpwd  = false;
			$('#login_content_username').blur(function(){
				var uname = $("#login_content_username").val();
				var res = /^[a-zA-Z_][a-zA-Z0-9]{3,15}/;
				if(!res.test(uname)){
					 $('#spana').css('color','red');
					$('#spana').text('用户名不符合规则');
					return false;
				}
				$.ajax({
					url:"{:U('User/dologin')}",
					data:{username:uname},
					type:'post',
					dataType:'json',
					success:function(res){
						switch(res){
							case 1:
								$('#spana').css('color','green');
								$('#spana').text('可以登录');
								backname=true;
							break;
							case 2:
								 $('#spana').css('color','red');
								$('#spana').text('用户名不存在');
								return false;
							break;
						}
					},
				});
			});

		$('#form').submit(function(){
		var upwd = $("#login_content_username").val();
		var upwd = $("#login_content_userpass").val();
			
		});
		});
	</script>
</body>
</html>